#pragma once


// CPreview

class CPreview : public CWnd
{
	DECLARE_DYNAMIC(CPreview)

public:

	CPreview(void);
	virtual ~CPreview(void);

protected:

	BOOL RegisterWndClass(void);
	static TCHAR m_szWndClass[];

private:

	CImage m_image;
	CImage m_preview;
	CCriticalSection m_lock;

	ULONG m_X, m_Y;

	const static RGBQUAD g_GrayScalePalette[256];

public:

	void OnFrameStart(void);
	void OnFrameStop(void);
	void OnLineStart(void);
	void OnLineDrop(void);
	void OnLineStop(void);
	void OnPixel(const BYTE & y);
	void Draw(HDC hDC);

protected:

	DECLARE_MESSAGE_MAP()

public:

	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnDestroy();
	afx_msg void OnPaint();
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
};

					
